<?php

namespace App\Http\Validate\Template;

use App\Http\Validate\BaseValidate;

/**
 * 权限组验证器
 */
class TemplateDispatchnote extends BaseValidate
{
    //验证规则
    protected $rule = [];
    //自定义验证信息
    protected $message = [];

    public function __construct($doaction = 'add')
    {
        if ($doaction == 'add') {
            $this->rule = [
                'dispatchnote_no' => 'required',
                'warehouse_name' => 'required',
                'dispatchnote_filepath' => 'required',
            ];
            $this->message = [
                'dispatchnote_no.required' => '编码不能为空',
                'warehouse_name.required' => '仓库名称不能为空',
                'dispatchnote_filepath.required' => '报车单模版未上传',
            ];
        } else {
            $this->rule = [
                'dispatchnote_no' => 'required',
                'warehouse_name' => 'required',
                'dispatchnote_filepath' => 'required',
            ];
            $this->message = [
                'dispatchnote_no.required' => '编码不能为空',
                'warehouse_name.required' => '仓库名称不能为空',
                'dispatchnote_filepath.required' => '报车单模版未上传',
            ];
        }
    }
}
